
#include "stdafx.h"

#include "game_main.h"
#include "game_scene.h"
#include "render\render.h"

GAME_STATE gameState;
CONFIG * gameConfig = NULL;

/******************************************************************************/
/* game_initialize
/*
/******************************************************************************/
bool game_initialize(void)
{
   gameConfig = NewObj(CONFIG);
   if (!gameConfig->Load("game.cfg")) {
      ShowErrorMsg("Failed to load game.cfg");
   }

   if (!render_initialize()) {
      return false;
   }

   return true;
}

/******************************************************************************/
/* game_term_level
/*
/******************************************************************************/
void game_term_level(void)
{
   Delete(gameState.scene);
}

/******************************************************************************/
/* game_loop
/*
/******************************************************************************/
void game_loop(void)
{
   game_load_level("test");

   while (!gameState.stopping) {
      render_frame();
   }

   game_term_level();
}

/******************************************************************************/
/* game_term
/*
/******************************************************************************/
void game_term(void)
{
   render_term();
}